// 权限管理路由

const express = require('express')

const router = express.Router()

// 导入权限路由处理函数模块
const authorizationHandle = require('../router_handler/authorization')

// 权限列表获取
router.get('/rights/:type', authorizationHandle.rightList)
router.get('/roles', authorizationHandle.rolesList)

// 根据id查询角色
router.get('/roles/:id', authorizationHandle.rolesQuiry)

// 添加角色
router.post('/roles', authorizationHandle.rolesAdd)
    // 编辑提交角色
router.put('/roles/:id', authorizationHandle.rolesEdit)

// 删除角色 
router.delete('/roles/:id', authorizationHandle.deleteRoles)
    // 角色授权
router.post('/roles/:roleId/rights', authorizationHandle.updateRoleRight)

// 删除角色授权
router.delete('/roles/:roleId/rights/:rightId', authorizationHandle.deleteRoleRight)
module.exports = router
    // /private/v1/